<template>
  <el-dialog :close-on-click-modal='false' v-drag :title="$t('详细信息（') + num + $t('条）')" append-to-body :visible.sync="dialogVisible" width="640px" top="10vh" @close='close'>
    <div class="dialogContentBoxMaxHeight80">
      <div v-for="item in infoList" :key="item">
        <div v-html="item" slot="content" class="showTip"></div>
      </div>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button @click="close" class="innerAddClose">{{$t('取 消')}}</el-button>
    </span>
  </el-dialog>
</template>
<script>
import { getRuleInfo } from '@/api/safe/ips'
export default {
  name: 'ruleInfoDialog',
  data () {
    return {
      dialogVisible: false,
      infoList: [],
      num: 0
    }
  },
  methods: {
    init (data) {
      this.dialogVisible = true
      getRuleInfo({ class_name: data }).then(res => {
        if (res.status === 0) {
          this.infoList = res.info
          this.num = res.info.length
        }
      })
    },
    close () {
      this.dialogVisible = false
      this.infoList = []
      this.num = 0
    }
  }
}
</script>
